
import java.sql.SQLException;
import java.util.Date;

import controllers.DBController;
import controllers.ServerUIP;
import controllers.SubscriberUIP;
import messagesPacks.SubExtendBorrowMessage;
import messagesPacks.SubscriberUpdateProfileMessage;
import fit.ActionFixture;
import gui.SubscriberUI;


public class ExtendBorrow  extends ActionFixture 

{
	 DBController dbc = null;
	 ServerUIP suip = null;
	 SubExtendBorrowMessage seb = null;

	 
public ExtendBorrow()
{
	try 
	{
		dbc = new DBController("localhost", 3306, "root","Braude","obl");
	} 
	catch (InstantiationException e) 
	{
		e.printStackTrace();
	} 
	catch (IllegalAccessException e) 
	{
		
		e.printStackTrace();
	} 
	catch (ClassNotFoundException e) 
	{
		e.printStackTrace();
	}
	catch (SQLException e) 
	{
		e.printStackTrace();
	}
	
	seb = new SubExtendBorrowMessage();
	suip = new ServerUIP(null);
	
}
	


	public void enterBorrowNumber(int bn)
	{
		seb.Br.borrowNumber = bn;
	}

	public void enterUserID(String userID)
	{
		seb.Br.userID=userID;
	}
	
	
	public void enterBookISBN(String isbn)
	{
		seb.Br.bookISBN = isbn ; 
	}
	

	public void enterReturnDate(String returnDate)
	{
		seb.Br.returnDate = returnDate ; 
	}
	

	public void extend_borrow()
	{
		dbc.SubExtendBorrow(seb,ServerUIP.clk);
		
	}
 
	public int Borrow()
	{
		return seb.msg_result;

	}

	

}
